/*
 * smooth_image.cpp
 *
 *  Created on: May 27, 2009
 *      Author: andrei
 */

#include "cv.h"
#include "highgui.h"

void smooth_image()
    // Create some windows to show the input
    // and output images in.
{
	IplImage* img = cvLoadImage("baboon.jpg");
	cvNamedWindow( "Example4-in" );
    cvNamedWindow( "Example4-out" );
    // Create a window to show our input image
    cvShowImage( "Example4-in", img );
    // Create an image to hold the smoothed output
    //
    IplImage* out = cvCreateImage(cvGetSize(img),IPL_DEPTH_8U,3);
    // Do the smoothing
    //
    cvSmooth( img, out, CV_GAUSSIAN, 3, 3 );
    // Show the smoothed image in the output window
    //
    cvShowImage( "Example4-out", out );
    // Be tidy
    //
    cvReleaseImage( &out );
    // Wait for the user to hit a key, then clean up the windows
    //
    cvWaitKey( 0 );
    cvDestroyWindow( "Example4-in" );
    cvDestroyWindow( "Example4-out" );
}
